<!--
    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<!--
    Copyright (c) 2015, Joyent, Inc.
-->

<div class="row">
    <div class="col-md-8 col-md-offset-1">
        <div class="page-header">
            <h3 class="modal-title"><span class="action"></span>
                {{#if account}}
                    Account Sub-user
                {{else}}
                    User
                {{/if}}
            </h3>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-9 col-md-offset-1">
        <div class="alert alert-danger"></div>
        <form class="form-horizontal" role="form">
            <div class="form-group">
                <label class="control-label col-xs-3">Login Name</label>
                <div class="col-xs-7">
                    <input type="text" name="login" class="form-control" autocomplete="off">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-3">Password</label>
                <div class="col-xs-7">
                    <input type="password" placeholder="Enter or update password" name="password" class="form-control" autocomplete="off">
                    <a data-toggle="tooltip" data-placement="bottom" data-trigger="hover"
                    title="Passwords must contain at least one number, one uppercase letter, one lowercase letter and one special character (note: check the pwdpolicy in LDAP for the min length and allowed characters). Avoid the use of repeating or sequential characters. Do not re-use recent passwords.">Password guidelines</a>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-3">Email Address</label>
                <div class="col-xs-7">
                    <input type="text" name="email" class="form-control col-xs-7" placeholder="user@example.com">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-3">Name</label>
                <div class="col-xs-3">
                    <input type="text" name="givenname" placeholder="given name" class="form-control">
                </div>
                <div class="col-xs-3">
                    <input type="text" name="sn" placeholder="last name" class="form-control">
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-3 control-label">Company</label>
                <div class="col-xs-7">
                    <input type="text" class="form-control" name="company" placeholder="Company name">
                </div>
            </div>

            <div class="form-group">
                <label class="col-xs-3 control-label">Tenant</label>
                <div class="col-xs-7">
                    <input type="text" class="form-control" name="tenant" placeholder="Tenant (used for grouping accounts)">
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-3">Phone Number</label>
                <div class="col-xs-7">
                    <input type="text" class="form-control" name="phone" placeholder="510-123-4567">
                </div>
            </div>

            {{#unless account}}

                <div class="form-group">
                    <label class="control-label col-xs-3">Role</label>
                    <div class="controls col-xs-7">
                        <div class="radio">
                            <label><input type="radio" name="groups" value=""> None</label>
                        </div>
                        <div class="radio">
                            <label><input type="radio" name="groups" value="readers"> Read-only Operator</label>
                        </div>
                        <div class="radio">
                            <label><input type="radio" name="groups" value="operators"> Full Access Operator</label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-xs-3">Permissions</label>
                    <div class="controls col-xs-7">
                        <div class="checkbox">
                            <label><input type="checkbox" name="approved_for_provisioning" value="true"> Approve For Provisioning</label>
                        </div>
                        <div class="checkbox">
                            <label><input type="checkbox" name="registered_developer" value="true"> User is a Registered Developer</label>
                        </div>
                        <div class="checkbox">
                            <label><input type="checkbox" name="triton_cns_enabled" value="true"> Use Container Naming Service</label>
                        </div>
                    </div>
                </div>

            {{/unless}}

            <div class="form-group">
                <div class="col-sm-offset-4 col-sm-8">
                    <button type="submit" class="save btn btn-primary">Save
                        {{#if account}}
                            Sub-user
                        {{else}}
                            User
                        {{/if}}
                    </button>
                    <button type="cancel" class="btn btn-default">Cancel</button>
                </div>
            </div>

            <input type="hidden" name="cn">
        </form>
    </div>
</div>
